package com.jcl.recruit.log.mapper;

import com.jcl.recruit.log.model.ResumeLog;
import com.jcl.recruit.org.model.Job;

import static org.apache.ibatis.jdbc.SqlBuilder.*;

public class ResumeLogProvider {

    public String insertSelective(ResumeLog record) {
        BEGIN();
        INSERT_INTO("resume_log");
        

        
        if (record.getCorpCode() != null) {
            VALUES("corp_code", "#{corpCode,jdbcType=VARCHAR}");
        }

        if (record.getUserId() != null) {
            VALUES("user_id", "#{userId,jdbcType=INTEGER}");
        }

        if (record.getResumeId() != null) {
            VALUES("resume_id", "#{resumeId,jdbcType=INTEGER}");
        }

        if (record.getLog() != null) {
            VALUES("log", "#{log,jdbcType=VARCHAR}");
        }

        if (record.getResumeType() != null) {
            VALUES("resume_type", "#{resumeType,jdbcType=VARCHAR}");
        }
        if (record.getCategory() != null) {
            VALUES("category", "#{category,jdbcType=INTEGER}");
        }
        if (record.getCreatetime() != null) {
            VALUES("createtime", "#{createtime,jdbcType=TIMESTAMP}");
        }
        
        return SQL();
    }

    public String updateByPrimaryKeySelective(ResumeLog record) {
        BEGIN();
        UPDATE("resume_log");

        if (record.getCorpCode() != null) {
            SET("corp_code=#{corpCode,jdbcType=VARCHAR}");
        }

        if (record.getUserId() != null) {
            SET("user_id=#{userId,jdbcType=INTEGER}");
        }

        if (record.getResumeId() != null) {
            SET("resume_id=#{resumeId,jdbcType=INTEGER}");
        }

        if (record.getLog() != null) {
            SET("log=#{log,jdbcType=VARCHAR}");
        }

        if (record.getResumeType() != null) {
            SET("resume_type=#{resumeType,jdbcType=VARCHAR}");
        }
        if (record.getCategory() != null) {
            SET("category=#{category,jdbcType=INTEGER}");
        }
        if (record.getCreatetime() != null) {
            SET("createtime=#{createtime,jdbcType=TIMESTAMP}");
        }

        WHERE("id = #{id,jdbcType=INTEGER}");
        
        return SQL();
    }
}